<!DOCTYPE html><html lang="en" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>R codes | 杜鑫辉医生的博客空间</title><meta name="author" content="杜鑫辉"><meta name="copyright" content="杜鑫辉"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="RNA seq data analysis and presentationstep 1 from raw count file to count matrix 12345678910111213141516171819202122232425262728293031323334list &lt;- list.files(pattern &#x3D; &quot;.gz&quot;)data &lt;- d">
<meta property="og:type" content="article">
<meta property="og:title" content="R codes">
<meta property="og:url" content="https://gitee.com/drduxinhui/2024/04/10/R-codes/index.html">
<meta property="og:site_name" content="杜鑫辉医生的博客空间">
<meta property="og:description" content="RNA seq data analysis and presentationstep 1 from raw count file to count matrix 12345678910111213141516171819202122232425262728293031323334list &lt;- list.files(pattern &#x3D; &quot;.gz&quot;)data &lt;- d">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="https://i.imgs.ovh/2023/10/04/V4AVR.th.jpeg">
<meta property="article:published_time" content="2024-04-10T07:07:01.000Z">
<meta property="article:modified_time" content="2024-04-10T07:11:51.166Z">
<meta property="article:author" content="杜鑫辉">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.imgs.ovh/2023/10/04/V4AVR.th.jpeg"><link rel="shortcut icon" href="/drduxinhui/img/favicon.png"><link rel="canonical" href="https://gitee.com/drduxinhui/2024/04/10/R-codes/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/drduxinhui/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
  root: '/drduxinhui/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: 'Copy successfully',
    error: 'Copy error',
    noSupport: 'The browser does not support'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '',
  dateSuffix: {
    just: 'Just',
    min: 'minutes ago',
    hour: 'hours ago',
    day: 'days ago',
    month: 'months ago'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/flickr-justified-gallery/dist/fjGallery.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: false,
  isAnchor: false,
  percent: {
    toc: true,
    rightside: false,
  },
  autoDarkmode: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'R codes',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2024-04-10 15:11:51'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
    win.getCSS = (url,id = false) => new Promise((resolve, reject) => {
      const link = document.createElement('link')
      link.rel = 'stylesheet'
      link.href = url
      if (id) link.id = id
      link.onerror = reject
      link.onload = link.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        link.onload = link.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(link)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><meta name="generator" content="Hexo 6.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="https://i.imgs.ovh/2023/10/04/V4AVR.th.jpeg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/drduxinhui/archives/"><div class="headline">Articles</div><div class="length-num">47</div></a><a href="/drduxinhui/tags/"><div class="headline">Tags</div><div class="length-num">0</div></a><a href="/drduxinhui/categories/"><div class="headline">Categories</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/drduxinhui/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/drduxinhui/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header"><nav id="nav"><span id="blog-info"><a href="/drduxinhui/" title="杜鑫辉医生的博客空间"><span class="site-name">杜鑫辉医生的博客空间</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/drduxinhui/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/drduxinhui/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">R codes</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">Created</span><time class="post-meta-date-created" datetime="2024-04-10T07:07:01.000Z" title="Created 2024-04-10 15:07:01">2024-04-10</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">Updated</span><time class="post-meta-date-updated" datetime="2024-04-10T07:11:51.166Z" title="Updated 2024-04-10 15:11:51">2024-04-10</time></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="R codes"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">Post View:</span><span id="busuanzi_value_page_pv"><i class="fa-solid fa-spinner fa-spin"></i></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="RNA-seq-data-analysis-and-presentation"><a href="#RNA-seq-data-analysis-and-presentation" class="headerlink" title="RNA seq data analysis and presentation"></a>RNA seq data analysis and presentation</h2><p>step 1 from raw count file to count matrix</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br></pre></td><td class="code"><pre><span class="line"></span><br><span class="line">list &lt;- list.files(pattern = &quot;.gz&quot;)</span><br><span class="line">data &lt;- data.frame()</span><br><span class="line">a &lt;- read.csv(&quot;C:/Users/drdux/AppData/Local/Temp/Rar$DRa14216.34566/GSM6276620_104399-001-001.count.txt&quot;,sep = &quot;&quot;,header = FALSE)</span><br><span class="line">rownames(a) &lt;- a[,2]</span><br><span class="line">colnames(a) &lt;- a[,1]</span><br><span class="line">a[,2]</span><br><span class="line">data &lt;- a ### data should not be null</span><br><span class="line">for(i in list)&#123;</span><br><span class="line">  path &lt;- i</span><br><span class="line">  data &lt;- cbind(data, read.csv(file = path, sep = &quot;&quot;,header = FALSE))</span><br><span class="line">&#125;</span><br><span class="line">data1 &lt;- data[,-c(1:3)]</span><br><span class="line">head (data1)</span><br><span class="line">### find and remove the duplicate columns in r</span><br><span class="line"># Find the Duplicated Columns</span><br><span class="line">duplicated_columns &lt;- duplicated(as.list(data1))</span><br><span class="line"># Show the Names of the Duplicated Columns</span><br><span class="line">colnames(data1[duplicated_columns])</span><br><span class="line"># Remove the Duplicated Columns</span><br><span class="line">my_data &lt;- data1[!duplicated_columns]</span><br><span class="line">#### remove duplicated</span><br><span class="line">my_data1 &lt;- my_data[!duplicated(my_data[,2]),]</span><br><span class="line">row.names(my_data1) &lt;- my_data1[,2]</span><br><span class="line"></span><br><span class="line">mdata &lt;- my_data1[,-c(1:2)]</span><br><span class="line">mdata1 &lt;- mdata + 1</span><br><span class="line"></span><br><span class="line">colnames(mdata1)&lt;- sample_id$X1</span><br><span class="line">head(mdata1)</span><br><span class="line">write.csv(mdata1, file = &quot;count_matrix_all.csv &quot;)</span><br><span class="line">lps_data &lt;- mdata1[,c(26:39)]</span><br><span class="line">write.csv(lps_data,file = &quot;count_matrix_lps.csv&quot;)</span><br><span class="line"></span><br></pre></td></tr></table></figure>
<p>step 2 DEG procedures</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br></pre></td><td class="code"><pre><span class="line">library(DESeq2)   </span><br><span class="line">library(pheatmap)  # 用于作热图的包</span><br><span class="line">library(ggplot2)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">c_matrix &lt;-as.data.frame(count_matrix_lps)</span><br><span class="line">row.names(c_matrix)&lt;- c_matrix[,1]</span><br><span class="line">countdata&lt;-c_matrix[,-1]</span><br><span class="line"></span><br><span class="line">## 去除过低表达基因</span><br><span class="line"></span><br><span class="line">countdata &lt;- countdata[rowMeans(countdata)&gt;10,]</span><br><span class="line">head(countdata)</span><br><span class="line">## 构建分组信息 very very important</span><br><span class="line">a &lt;- colnames(countdata)</span><br><span class="line">a</span><br><span class="line">write.csv(a,file = &quot;sample_Id.csv&quot;)</span><br><span class="line"></span><br><span class="line">condition &lt;- as.factor(sample_id$X2)</span><br><span class="line">summary(condition)</span><br><span class="line"></span><br><span class="line">coldata &lt;- data.frame(row.names = colnames(countdata),condition)</span><br><span class="line">coldata</span><br><span class="line">## 差异表达分析</span><br><span class="line">dds &lt;- DESeqDataSetFromMatrix(countData = countdata, </span><br><span class="line">                              colData = coldata, design = ~ condition)</span><br><span class="line">dds1 &lt;- DESeq(dds) </span><br><span class="line">res &lt;- results(dds1)</span><br><span class="line">summary(res) </span><br><span class="line">write.csv(res, file = &quot;All_DEG_results.csv&quot;)</span><br><span class="line">table(res$padj&lt;0.05)</span><br><span class="line">##### DEG results analysis</span><br></pre></td></tr></table></figure>

<p>step 3 GO, KEGG, GSEA functional enrichment</p>
<figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br></pre></td><td class="code"><pre><span class="line">#### 载入工具包</span><br><span class="line">library(openxlsx)#读取.xlsx文件</span><br><span class="line">library(ggplot2)#柱状图和点状图</span><br><span class="line">library(stringr)#基因ID转换</span><br><span class="line">library(enrichplot)#GO,KEGG,GSEA</span><br><span class="line">library(clusterProfiler)#GO,KEGG,GSEA</span><br><span class="line">library(GOplot)#弦图，弦表图，系统聚类图</span><br><span class="line">library(DOSE)</span><br><span class="line">library(ggnewscale)</span><br><span class="line">library(topGO)#绘制通路网络图</span><br><span class="line">library(circlize)#绘制富集分析圈图</span><br><span class="line">library(ComplexHeatmap)#绘制图例</span><br><span class="line">library(org.Mm.eg.db)</span><br><span class="line"></span><br><span class="line"># BiocManager::install(&quot;org.Mm.eg.db&quot;)</span><br><span class="line"></span><br><span class="line">### 导入差异表达基因数据</span><br><span class="line">head(All_DEG_results)</span><br><span class="line">### filter by log2foldchange and pavlue</span><br><span class="line">deg &lt;- All_DEG_results %&gt;% filter(abs(log2FoldChange)&gt; 1, pvalue &lt; 0.05)</span><br><span class="line">write.csv(deg, file = &quot;DEGs.csv&quot;)</span><br><span class="line"></span><br><span class="line">head(deg)</span><br><span class="line"></span><br><span class="line">#指定富集分析的物种库</span><br><span class="line">GO_database &lt;- &#x27;org.Mm.eg.db&#x27;</span><br><span class="line">KEGG_database &lt;- &#x27;mmu&#x27;</span><br><span class="line">#gene ID转换</span><br><span class="line">diff_gene_deseq2 &lt;- deg</span><br><span class="line"></span><br><span class="line">### geneid type include ENSEMBL, SYMBOL, ENTREZID. </span><br><span class="line">gene &lt;- bitr(diff_gene_deseq2$X,fromType = &#x27;ENSEMBL&#x27;,toType = &#x27;SYMBOL&#x27;,OrgDb = GO_database)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">## Go 分析</span><br><span class="line">GO&lt;-enrichGO( gene$ENTREZID,#GO富集分析</span><br><span class="line">              OrgDb = GO_database,</span><br><span class="line">              keyType = &quot;ENTREZID&quot;,#设定读取的gene ID类型</span><br><span class="line">              ont = &quot;ALL&quot;,#(ont为ALL因此包括 Biological Process,Cellular Component,Mollecular Function三部分）</span><br><span class="line">              pvalueCutoff = 0.05,#设定p值阈值</span><br><span class="line">              qvalueCutoff = 0.05,#设定q值阈值</span><br><span class="line">              readable = T)</span><br><span class="line">## kegg 分析</span><br><span class="line">KEGG&lt;-enrichKEGG(gene$ENTREZID,#KEGG富集分析</span><br><span class="line">                 organism = KEGG_database,</span><br><span class="line">                 pvalueCutoff = 0.05,</span><br><span class="line">                 qvalueCutoff = 0.05)</span><br><span class="line">## GSEA 分析</span><br><span class="line">info &lt;- diff_gene_deseq2</span><br><span class="line">head(info)</span><br><span class="line">head(gene)</span><br><span class="line">names(info) &lt;- c(&quot;ENSEMBL&quot;,&quot;baseMean&quot;,&quot;log2FoldChange&quot;,&quot;stat&quot;,&quot;pvalue&quot;,&quot;padj&quot; )</span><br><span class="line"></span><br><span class="line">info_merge$log2FoldChange &lt;- - info_merge$log2FoldChange</span><br><span class="line">write.csv(info_merge,file = &quot;DEGs.csv&quot;)</span><br><span class="line"></span><br><span class="line">info_merge &lt;- merge(info, gene, by = &quot;ENSEMBL&quot;) # 合并转换后的基因ID和Log2FoldChange</span><br><span class="line">GSEA_input &lt;- info_merge$log2FoldChange</span><br><span class="line">names(GSEA_input) = info_merge$ENTREZID</span><br><span class="line">GSEA_input = sort(GSEA_input, decreasing = TRUE)</span><br><span class="line">GSEA_KEGG &lt;- gseKEGG(GSEA_input, organism = KEGG_database, pvalueCutoff = 0.05)#GSEA富集分析</span><br><span class="line">GSEA_KEGG</span><br><span class="line"></span><br><span class="line">dotplot(GSEA_KEGG, showCategory=7, split=&quot;.sign&quot;) + facet_grid(.~.sign)</span><br><span class="line">ridgeplot(GSEA_KEGG) + labs(x = &quot;enrichment distribution&quot;)</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"># 3.1 GO/KEGG富集柱状图+点状图:</span><br><span class="line">barplot(GO, split=&quot;ONTOLOGY&quot;)+facet_grid(ONTOLOGY~., scale=&quot;free&quot;)#柱状图</span><br><span class="line">barplot(KEGG,showCategory = 40,title = &#x27;KEGG Pathway&#x27;)</span><br><span class="line">dotplot(GO, split=&quot;ONTOLOGY&quot;)+facet_grid(ONTOLOGY~., scale=&quot;free&quot;)#点状图</span><br><span class="line">dotplot(KEGG)</span><br><span class="line">ridgeplot(GSEA_KEGG) </span><br><span class="line">gseaplot2(GSEA_KEGG,1)</span><br><span class="line">gseaplot2(GSEA_KEGG,1:7) #7是根据ridgeplot中有7个富集通路得到的</span><br><span class="line">## 富集基因与所在功能集/通路集的关联网络图</span><br><span class="line">enrichplot::cnetplot(GO,circular=FALSE,colorEdge = TRUE)#基因-通路关联网络图</span><br><span class="line">enrichplot::cnetplot(KEGG,circular=FALSE,colorEdge = TRUE)#circluar为指定是否环化，基因过多时建议设置为FALSE</span><br><span class="line"></span><br></pre></td></tr></table></figure></article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">Author: </span><span class="post-copyright-info"><a href="https://gitee.com/drduxinhui">杜鑫辉</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">Link: </span><span class="post-copyright-info"><a href="https://gitee.com/drduxinhui/2024/04/10/R-codes/">https://gitee.com/drduxinhui/2024/04/10/R-codes/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">Copyright Notice: </span><span class="post-copyright-info">All articles in this blog are licensed under <a target="_blank" rel="noopener" href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC BY-NC-SA 4.0</a> unless stating additionally.</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="https://i.imgs.ovh/2023/10/04/V4AVR.th.jpeg" data-sites="facebook,twitter,wechat,weibo,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/sharejs/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="next-post pull-full"><a href="/drduxinhui/2024/02/06/How-to-write-a-paper/" title="How to write a paper"><div class="cover" style="background: var(--default-bg-color)"></div><div class="pagination-info"><div class="label">Next Post</div><div class="next_info">How to write a paper</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="https://i.imgs.ovh/2023/10/04/V4AVR.th.jpeg" onerror="this.onerror=null;this.src='/drduxinhui/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">杜鑫辉</div><div class="author-info__description"></div></div><div class="card-info-data site-data is-center"><a href="/drduxinhui/archives/"><div class="headline">Articles</div><div class="length-num">47</div></a><a href="/drduxinhui/tags/"><div class="headline">Tags</div><div class="length-num">0</div></a><a href="/drduxinhui/categories/"><div class="headline">Categories</div><div class="length-num">0</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/xxxxxx"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="mailto:drduxinhui@163.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>Announcement</span></div><div class="announcement_content">This is my Blog</div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>Catalog</span><span class="toc-percentage"></span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#RNA-seq-data-analysis-and-presentation"><span class="toc-number">1.</span> <span class="toc-text">RNA seq data analysis and presentation</span></a></li></ol></div></div><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>Recent Post</span></div><div class="aside-list"><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/drduxinhui/2024/04/10/R-codes/" title="R codes">R codes</a><time datetime="2024-04-10T07:07:01.000Z" title="Created 2024-04-10 15:07:01">2024-04-10</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/drduxinhui/2024/02/06/How-to-write-a-paper/" title="How to write a paper">How to write a paper</a><time datetime="2024-02-06T06:43:49.000Z" title="Created 2024-02-06 14:43:49">2024-02-06</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/drduxinhui/2024/02/05/%E4%B8%B4%E5%BA%8A%E5%A4%A7%E4%BD%93%E7%85%A7%E7%89%87/" title="临床大体照片">临床大体照片</a><time datetime="2024-02-05T09:23:33.000Z" title="Created 2024-02-05 17:23:33">2024-02-05</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/drduxinhui/2024/02/03/%E6%95%B0%E5%AD%97%E5%8C%96%E9%87%8D%E5%BB%BA2%E2%80%94%E2%80%94%E8%85%93%E9%AA%A8%E8%BF%91%E7%AB%AF%E9%AA%A8%E8%82%BF%E7%98%A4/" title="数字化重建2——腓骨近端骨肿瘤">数字化重建2——腓骨近端骨肿瘤</a><time datetime="2024-02-03T08:39:16.000Z" title="Created 2024-02-03 16:39:16">2024-02-03</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/drduxinhui/2024/02/03/%E4%B8%AA%E4%BA%BA%E7%85%A7%E7%89%87%E9%A1%B5/" title="个人照片页">个人照片页</a><time datetime="2024-02-02T23:37:15.000Z" title="Created 2024-02-03 07:37:15">2024-02-03</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2020 - 2024 By 杜鑫辉</div><div class="framework-info"><span>Framework </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>Theme </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="Read Mode"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="Switch Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between single-column and double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="Table Of Contents"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="Back To Top"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/drduxinhui/js/utils.js"></script><script src="/drduxinhui/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"><script>(() => {
  const $mermaid = document.querySelectorAll('#article-container .mermaid-wrap')
  if ($mermaid.length === 0) return
  const runMermaid = () => {
    window.loadMermaid = true
    const theme = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'default'

    Array.from($mermaid).forEach((item, index) => {
      const mermaidSrc = item.firstElementChild
      const mermaidThemeConfig = '%%{init:{ \'theme\':\'' + theme + '\'}}%%\n'
      const mermaidID = 'mermaid-' + index
      const mermaidDefinition = mermaidThemeConfig + mermaidSrc.textContent

      const renderFn = mermaid.render(mermaidID, mermaidDefinition)

      const renderV10 = () => {
        renderFn.then(({svg}) => {
          mermaidSrc.insertAdjacentHTML('afterend', svg)
        })
      }

      const renderV9 = svg => {
        mermaidSrc.insertAdjacentHTML('afterend', svg)
      }

      typeof renderFn === 'string' ? renderV9(renderFn) : renderV10()
    })
  }

  const loadMermaid = () => {
    window.loadMermaid ? runMermaid() : getScript('https://cdn.jsdelivr.net/npm/mermaid/dist/mermaid.min.js').then(runMermaid)
  }

  btf.addModeChange('mermaid', runMermaid)

  window.pjax ? loadMermaid() : document.addEventListener('DOMContentLoaded', loadMermaid)
})()</script></div><script defer="defer" id="fluttering_ribbon" mobile="true" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc/dist/canvas-fluttering-ribbon.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>